/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package introse1;

import java.sql.ResultSet;
import java.sql.Connection;
import java.sql.PreparedStatement;
/**
 *
 * @author Russell
 */
//lagay mo na lang yung pang add ng variables sa databsae dito -Sam
public class InventoryManager {
    public static PreparedStatement pstmt;
    public static DBConnect conn = new DBConnect();
    public static Connection pangkonek = conn.connect();
    public static VariableList variables;
    public static ResultSet res;
    
    public void addInventory(VariableList bariable){
        /*PLease fix -Sam*/
        try{
            pstmt = pangkonek.prepareStatement("Insert INTO inventory (inventoryName, quantity, UnitofMeasure, price, ingredientUsed) VALUES(?,?,?,?,?)");
            pstmt.setString(1, bariable.getInventory_name());
            pstmt.setFloat(2, bariable.getInventory_quantity());
            pstmt.setString(3, bariable.getUnit_of_measure());
            pstmt.setFloat(4, bariable.getInventory_price());
            pstmt.setFloat(5, 0);
            pstmt.executeUpdate();
        }catch(Exception e){
            System.out.println("Error");
        }
        
    }
}

